package cn.qn.controller.security;

import cn.qn.dto.ResponseDTO;
import cn.qn.dto.security.MenuDTO;
import cn.qn.service.security.MenuService;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jeet
 * 2018年6月4日 16:26:04
 */
@RestController
@Api("菜单信息")
@RequestMapping("/security/menu")
public class MenuController {

    @Reference(check = false)
    private MenuService menuService;

    /**
     * 所有菜单
     */
    @ApiOperation(value = "查询所有菜单", notes = "查询所有菜单", produces = MediaType.APPLICATION_JSON_VALUE, response = MenuDTO.class)
    @RequestMapping(value = "/page", method = RequestMethod.GET)
    public ResponseDTO rolePage() {
        return ResponseDTO.success(menuService.menuPage());
    }


}
